package com.feiyu.config;

import com.feiyu.bean.SysUser;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

/**
 * @author nanshouxiao@teacher.com.cn
 * @date 2017-11-03 15:03
 */
@Data
public class CustomUserDetail extends User {

    private String email;

    public CustomUserDetail(SysUser user, Collection<? extends GrantedAuthority> authorities) {
        super(user.getUsername(), user.getPassword(), authorities);
        this.email = user.getEmail();
    }
}
